htmlcssfandomcom_ru-20200214-history
The HTML syntax
12 The HTML syntax 12.1 Writing HTML documents 12.1.1 The DOCTYPE 12.1.2 Elements 12.1.2.1 Start tags 12.1.2.2 End tags 12.1.2.3 Attributes 12.1.2.4 Optional tags 12.1.2.5 Restrictions on content models 12.1.2.6 Restrictions on the contents of raw text and escapable raw text elements 12.1.3 Text 12.1.3.1 Newlines 12.1.4 Character references 12.1.5 CDATA sections 12.1.6 Comments 12.2 Parsing HTML documents 12.2.1 Overview of the parsing model 12.2.2 The input byte stream 12.2.2.1 Parsing with a known character encoding 12.2.2.2 Determining the character encoding 12.2.2.3 Character encodings 12.2.2.4 Changing the encoding while parsing 12.2.2.5 Preprocessing the input stream 12.2.3 Parse state 12.2.3.1 The insertion mode 12.2.3.2 The stack of open elements 12.2.3.3 The list of active formatting elements 12.2.3.4 The element pointers 12.2.3.5 Other parsing state flags 12.2.4 Tokenization 12.2.4.1 Data state 12.2.4.2 Character reference in data state 12.2.4.3 RCDATA state 12.2.4.4 Character reference in RCDATA state 12.2.4.5 RAWTEXT state 12.2.4.6 Script data state 12.2.4.7 PLAINTEXT state 12.2.4.8 Tag open state 12.2.4.9 End tag open state 12.2.4.10 Tag name state 12.2.4.11 RCDATA less-than sign state 12.2.4.12 RCDATA end tag open state 12.2.4.13 RCDATA end tag name state 12.2.4.14 RAWTEXT less-than sign state 12.2.4.15 RAWTEXT end tag open state 12.2.4.16 RAWTEXT end tag name state 12.2.4.17 Script data less-than sign state 12.2.4.18 Script data end tag open state 12.2.4.19 Script data end tag name state 12.2.4.20 Script data escape start state 12.2.4.21 Script data escape start dash state 12.2.4.22 Script data escaped state 12.2.4.23 Script data escaped dash state 12.2.4.24 Script data escaped dash dash state 12.2.4.25 Script data escaped less-than sign state 12.2.4.26 Script data escaped end tag open state 12.2.4.27 Script data escaped end tag name state 12.2.4.28 Script data double escape start state 12.2.4.29 Script data double escaped state 12.2.4.30 Script data double escaped dash state 12.2.4.31 Script data double escaped dash dash state 12.2.4.32 Script data double escaped less-than sign state 12.2.4.33 Script data double escape end state 12.2.4.34 Before attribute name state 12.2.4.35 Attribute name state 12.2.4.36 After attribute name state 12.2.4.37 Before attribute value state 12.2.4.38 Attribute value (double-quoted) state 12.2.4.39 Attribute value (single-quoted) state 12.2.4.40 Attribute value (unquoted) state 12.2.4.41 Character reference in attribute value state 12.2.4.42 After attribute value (quoted) state 12.2.4.43 Self-closing start tag state 12.2.4.44 Bogus comment state 12.2.4.45 Markup declaration open state 12.2.4.46 Comment start state 12.2.4.47 Comment start dash state 12.2.4.48 Comment state 12.2.4.49 Comment end dash state 12.2.4.50 Comment end state 12.2.4.51 Comment end bang state 12.2.4.52 DOCTYPE state 12.2.4.53 Before DOCTYPE name state 12.2.4.54 DOCTYPE name state 12.2.4.55 After DOCTYPE name state 12.2.4.56 After DOCTYPE public keyword state 12.2.4.57 Before DOCTYPE public identifier state 12.2.4.58 DOCTYPE public identifier (double-quoted) state 12.2.4.59 DOCTYPE public identifier (single-quoted) state 12.2.4.60 After DOCTYPE public identifier state 12.2.4.61 Between DOCTYPE public and system identifiers state 12.2.4.62 After DOCTYPE system keyword state 12.2.4.63 Before DOCTYPE system identifier state 12.2.4.64 DOCTYPE system identifier (double-quoted) state 12.2.4.65 DOCTYPE system identifier (single-quoted) state 12.2.4.66 After DOCTYPE system identifier state 12.2.4.67 Bogus DOCTYPE state 12.2.4.68 CDATA section state 12.2.4.69 Tokenizing character references 12.2.5 Tree construction 12.2.5.1 Creating and inserting nodes 12.2.5.2 Parsing elements that contain only text 12.2.5.3 Closing elements that have implied end tags 12.2.5.4 The rules for parsing tokens in HTML content 12.2.5.4.1 The "initial" insertion mode 12.2.5.4.2 The "before html" insertion mode 12.2.5.4.3 The "before head" insertion mode 12.2.5.4.4 The "in head" insertion mode 12.2.5.4.5 The "in head noscript" insertion mode 12.2.5.4.6 The "after head" insertion mode 12.2.5.4.7 The "in body" insertion mode 12.2.5.4.8 The "text" insertion mode 12.2.5.4.9 The "in table" insertion mode 12.2.5.4.10 The "in table text" insertion mode 12.2.5.4.11 The "in caption" insertion mode 12.2.5.4.12 The "in column group" insertion mode 12.2.5.4.13 The "in table body" insertion mode 12.2.5.4.14 The "in row" insertion mode 12.2.5.4.15 The "in cell" insertion mode 12.2.5.4.16 The "in select" insertion mode 12.2.5.4.17 The "in select in table" insertion mode 12.2.5.4.18 The "in template" insertion mode 12.2.5.4.19 The "after body" insertion mode 12.2.5.4.20 The "in frameset" insertion mode 12.2.5.4.21 The "after frameset" insertion mode 12.2.5.4.22 The "after after body" insertion mode 12.2.5.4.23 The "after after frameset" insertion mode 12.2.5.5 The rules for parsing tokens in foreign content 12.2.6 The end 12.2.7 Coercing an HTML DOM into an infoset 12.2.8 An introduction to error handling and strange cases in the parser 12.2.8.1 Misnested tags: 12.2.8.2 Misnested tags: 12.2.8.3 Unexpected markup in tables 12.2.8.4 Scripts that modify the page as it is being parsed 12.2.8.5 The execution of scripts that are moving across multiple documents 12.2.8.6 Unclosed formatting elements 12.3 Serialising HTML fragments 12.4 Parsing HTML fragments 12.5 Named character references